Repository navigation
engine: project statement checkpoints onto GET /build - #21
Conversation
Code4me2
left a comment
There was a problem hiding this comment.
MERGE
Adversarial review of engine: project statement checkpoints onto GET /build (140082e vs main). Issue #15. Did not merge. No fix pushed — nothing in this PR's scope is merge-blocking.
Checkpoints actually land on GET /build
The worker list is no longer dropped at assemble. StatementCheckpoint is a first-class §8 field (BuildResult.checkpoints), assemble_build persists the worker stops, and build_projection always emits checkpoints[] (named [] on pre-field records and on not_built). GET /parts/{part}/build reads current, then last-failure when there is no current. HTTP tests: successful projection, first-fail serves the failed record, later success still wins.
The Timeline does not invent a statement list from script text. marksFromBuild walks build.checkpoints and only then the positions the error / current artifact already named.
Last-good facts are real
Publication still mints at most one checkpoint blob — the failed-build last-good BRep. Intermediate stops stay artifact_ref: null. The runner attaches that minted ref to the stop whose line is error.built_through.line (else the last completed stop). The web last-good kind is checkpoint.artifact_ref === error.last_good_artifact_ref; rewind is still hold of that ref. Successful builds do not grow a rewind scrubber.
_LastGood.update sets statement on every completed statement, so last-good is the last checkpoint under the current worker. The first-line-match join equals checkpoints[-1] except for the rare two-top-level-statements-on-one-line case. The blob is not invented either way.
Old records without checkpoints[] still project last-good vs failed from the error object. That is a join of an existing field, not a client-side event.
No web chrome drive-by
Web edits stay on the Timeline surface (marks helper, Timeline.tsx, Timeline CSS, copy, types, fixtures, tests). Tree, Results, viewport, composer, appearance, export are untouched. The horizontal → column marks list is the existing panel growing engine stops, not a restyle of other chrome.
G4 / G5 not weakened
- G4.2:
geometry_countis stilllen(BuildResult.geometries), explicit on the projection. Current still wins over a later failure (tested). The G4 e2e still reads/parts/tread/buildon a successful current. First-fail failed records have emptygeometries(worker returns before the index), so row count stays 0 = 0. Properties still readcurrent_buildonly (G4.3). - G5: no mutation, Monaco, slider, selection, A/B provenance, or idempotency change.
Non-blocking
http/context.pystill doesbuild_projection(runtime.cad.current_build(part))afterblock.read("/parts/{part}/build"). A first-fail part now has checkpoints on the route and "no current build" in the composer context. Context's sentence is still true; the claimed route identity is not. Mission rule 6, not a gate break. Follow-up if context goldens are expected to mirror GET.- Attach-by-first-matching-line is a weaker join key than "last completed statement" /
built_through.statement. Fine for one statement per line (the CAD corpus). Not a false blob. checkpointsis optional on the §8 schema (requiredunchanged,additionalProperties: falsestill holds). Honest for old records.
Verdict: MERGE. #15 is met; last-good is a minted ref; G4.2 current-wins is intact; chrome stay on Timeline.
Persist the incremental executor's per-statement checkpoints on the
§8 BuildResult and serve them from GET /parts/{part}/build so the
Timeline can grow stops from the engine projection instead of last-good
vs failed only.
A first-fail part now projects the last-failure record (not a not_built
silence). Current successful builds still win, so G4.2 geometry_count
is unchanged. Intermediate checkpoints carry no invented artifact refs;
only the last-good stop of a failed build is minted.
Co-authored-by: Vel <Code4me2@users.noreply.github.com>
The lint+type job failed on list[Unknown] after reading checkpoints off the HTTP body. Cast the projection to list[dict] like the other server tests. Co-authored-by: Vel <Code4me2@users.noreply.github.com>
140082e to
16efec5
Compare
Fixes #15. Parent #4 remains open.
Why
After #6 the web Timeline was last-good vs failed only. The incremental executor already records per-statement
checkpointsinside the worker (index, span, bound names). Those stops were dropped when assembling the §8BuildResult, soGET /parts/{part}/buildcould not name them. INTERFACE.md §0.1: if the engine does not say it, do not paint it.Engine
StatementCheckpointis a first-class §8 field (BuildResult.checkpoints). Old records read back as[].lineand the verbatim statement text, so a Timeline can name a stop without slicing the script.assemble_buildpersists the worker list. Publication mints at most one checkpoint blob — the last-good BRep of a failed build — and attaches that ref to the matching stop. Intermediate stops carryartifact_ref: null(mission rule 4: no invented per-statement BRep).GET /parts/{part}/buildprojectscheckpoints[].not_built. A later success still wins, so G4.2geometry_countstays a fact about the current build.Web
marksFromBuildemits one mark per projected checkpoint. A checkpoint whoseartifact_refis the error's last-good ref is the rewindable last-good stop. The scrubber still only holds that minted ref; it does not invent statement events from the script text.Out of scope
Appearance, tree, export, composer, CLI verbs, install docs, laser CAM, scan import. Smith/Arche in prose only. Does not close #4.
Tests
GET /buildcarries checkpoints; first-fail serves last-failure; current wins over a later failure.